import java.util.Scanner;

/**
 * @author gao
 * @date 2025/9/11 9:19
 */

public class Solution {
    public int getMaxLen(int[] nums) {
        int n = nums.length, ret = -1;

        int[] f = new int[n + 1];
        int[] g = new int[n + 1];

        for (int i = 1; i <= n; i++) {
            int len = g[i - 1] == 0 ? 0 : g[i - 1] + 1;
            if (nums[i - 1] > 0) {
                f[i] = f[i - 1] + 1;
                g[i] = len;
            } else if (nums[i - 1] < 0) {
                f[i] = len;
                g[i] = f[i - 1] + 1;
            }
            ret = Math.max(ret, f[i]);
        }
        return ret;
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNext()) {
            int n = in.nextInt();
            int[] nums = new int[n];
            for (int i = 0; i < nums.length; i++) {
                nums[i] = in.nextInt();
            }
            Solution solution = new Solution();
            System.out.println(solution.getMaxLen(nums));
        }
    }
}